
package com.soft.controller;

import com.soft.bean.Car;
import com.soft.bean.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

  @Autowired
  private Car car;

  @Autowired
  private Person person;

  @RequestMapping("/hello")
  public String sayHello() {
    return "hello springboot2!";
  }

  @RequestMapping("/car")
  public Car getCar() {

    return car;
  }

  @RequestMapping("/person")
  public Person getPerson() {
    System.out.println(person);
    return person;
  }

}
